/*
 * @(#)DonateController.java 2019年12月20日 下午2:32:25
 * Copyright 2019 zmr, Inc. All rights reserved.
 * PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.wjy.icu.controller;




import com.wjy.icu.common.annotation.PassToken;
import com.wjy.icu.common.core.controller.BaseController;
import com.wjy.icu.common.core.domain.R;
import com.wjy.icu.domain.Sms;
import com.wjy.icu.service.ISmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>File：DonateController.java</p>
 * <p>Title: </p>
 * <p>Description:</p>
 * <p>Copyright: Copyright (c) 2019 2019年12月20日 下午2:32:25</p>
 * <p>Company: zmrit.com </p>
 *
 * @author zmr
 * @version 1.0
 */
@RestController
public class AccountController extends BaseController {
    @Autowired
    private ISmsService smsService;
    @PassToken
    @PostMapping("account/sms")
    public R sendSms(@RequestBody Sms sms) {
        smsService.sendSms(sms.getMobile(),sms.getType(),true);
        return R.ok();
    }
    @PassToken
    @PostMapping("system/account/smsVerify")
    public R verify(@RequestBody Sms sms) {
        smsService.verify(sms.getMobile(),sms.getType(),sms.getCode());
        return R.ok();
    }

}
